package com.lanou.dllo.mynovel.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.lanou.dllo.mynovel.fragment.FragmentFactory;

/**
 * Created by dllo on 15/10/27.
 */
public class TabLayoutAdapter extends FragmentPagerAdapter {

    private String[] titles = {"精品","更新", "排行", "分类", "搜索"};

    public TabLayoutAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        return FragmentFactory.creatFragment(position);
    }

    @Override
    public int getCount() {
        return titles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
